package com.fjxd.feign.clients;

import com.fjxd.feign.fallback.PlaneTicketClientFallbackFactory;
import com.fjxd.feign.pojo.Ticket;
import com.fjxd.feign.pojo.vo.TicketVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

/**
 * @author csw
 */
@FeignClient(value = "planeTicketService", fallbackFactory = PlaneTicketClientFallbackFactory.class)
public interface PlaneTicketClient {

    /**
     * 通过机票id 获取机票信息
     *
     * @param id 机票id
     * @return 返回一个机票对象
     */
    @GetMapping("/planeTicketQuery/getTicket/{id}")
    Ticket getTicketId(@PathVariable Integer id);

    /**
     * @return 返回所有机票信息
     */
    @GetMapping("/planeTicketQuery/getAll")
    List<Ticket> getAll();

    @GetMapping("/planeTicketQuery/getPlaneByFid/{fid}")
    Ticket getPlaneByFid(@PathVariable Integer fid);
}
